package com.etung.iot.demo.modles;

import lombok.Data;

@Data
public class MyPair<T> {
    private T first;
    private T second;

    public void put(T data){
        if(first == null){
            first = data;
        }else if (second == null){
            second = data;
        }else{
            first = second;
            second = data;
        }
    }

    public T getLastData(){
        if (first != null && second != null){
            return first;
        }
        return null;
    }
}
